//
//  SGJNavController.m
//  Sewage
//
//  Created by 宗庆猛 on 2017/5/26.
//  Copyright © 2017年 宗庆猛. All rights reserved.
//

#import "SGJNavController.h"

@interface SGJNavController ()

@end

@implementation SGJNavController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
     //取消导航栏下面的分隔线
    [self.navigationBar setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[[UIImage alloc]init]];

    //如果上面设置了空的背景图片和空的阴影图片，必须要设置translucent为no才能够看到背景颜色
    self.navigationBar.translucent = NO;
    self.navigationController.navigationBar.hidden = YES;
    
    self.navigationBar.barTintColor = [UIColor blueColor];
    
    //设置导航栏的标题文字颜色为白色
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
}

// 导航控制器不再统一设置状态栏的样式。显示的是哪个控制器，就由哪个控制器自己设置
- (UIViewController *)childViewControllerForStatusBarStyle{
    return self.topViewController;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
